#ifndef APPLICATION_H
#define APPLICATION_H

#include <QObject>
#include "common/singleton.h"
#include "eventid.h"
#include "messagequeue.h"

class Application : public QObject
{
    Q_OBJECT
public:
    explicit Application(QObject *parent = nullptr);

    void start();

    // 发布订阅接口
    void publish(QEvent* event);
    void publish(QObject *obj, QEvent* event);
    void subscribe(quint16 id, QObject* who);
    void unsubscribe(quint16 id, QObject* who);

signals:

public slots:

    SINGLETON_DECLARE(Application)

private:
    MessageQueue 	m_messageQueue;
};

//#define app Application::getInstance()

#endif // APPLICATION_H
